//
//  ZGSOptionCell.m
//  MapleLeaf
//
//  Created by 邝子涵 on 15/12/8.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSOptionCell.h"

@implementation ZGSOptionCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}

- (void)createViews {
    [self.contentView addSubview:self.leftImageView];
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.rightImageView];
    [self.contentView addSubview:self.lineView];
}

- (UIImageView *)leftImageView {
    if (!_leftImageView) {
        self.leftImageView = [[UIImageView alloc] init];
    }
    return _leftImageView;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        self.titleLabel = [[UILabel alloc] init];
    }
    return _titleLabel;
}

- (UIImageView *)rightImageView {
    if (!_rightImageView) {
        self.rightImageView = [[UIImageView alloc] init];
    }
    return _rightImageView;
}

- (UIView *)lineView {
    if (!_lineView) {
        self.lineView = [[UIView alloc] init];
        _lineView.layer.borderWidth = 1;
        _lineView.layer.borderColor = [[UIColor colorWithRed:0.871f green:0.871f blue:0.871f alpha:1.00f] CGColor];
    }
    return _lineView;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.leftImageView.frame = CGRectMake(15 / 375.0 * WIDTH, 10 / 667.0 * HEIGHT, 30 / 667.0 * HEIGHT, 30 / 667.0 * HEIGHT);
    self.titleLabel.frame = CGRectMake(60 / 375.0 * WIDTH, 25 / 667.0 * HEIGHT - 10, 180 / 375.0 * WIDTH, 20);
    self.rightImageView.frame = CGRectMake(WIDTH -  45 / 667.0 * HEIGHT, 10 / 667.0 * HEIGHT, 30 / 667.0 * HEIGHT, 30 / 667.0 * HEIGHT);
    self.lineView.frame = CGRectMake(0, 49 / 667.0 * HEIGHT, WIDTH, 1);
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
